package com.yitong.xjd.dao;

import java.math.BigDecimal;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;


@Repository
public class GongJiJinDaiDaoImpl implements GongJiJinDaiDao{
	
	@Autowired
	@Qualifier("secondJdbcTemplate")
    private JdbcTemplate jdbcTemplate;
	
	//获取crm合并mergeId
	@Override
	public String getMergeId(String custno) {
		String sql="select cust_id from cust_info where cust_no=?";
		BigDecimal c=jdbcTemplate.queryForObject(sql, new Object[]{custno}, java.math.BigDecimal.class);
		if(c==null){
			return null;
		}else{
			return c.toString();
		}
	}

	@Override
	public String getNowTime(String format) {
		String sql=	"select to_char(sysdate,?) from dual";
		String c=jdbcTemplate.queryForObject(sql, new Object[]{format}, String.class);
		return c;
	}

}
